package cn.lh.exception;

import cn.lh.enums.GlobalErrorCode;
import lombok.Getter;

@Getter
public class GlobalCustomException extends RuntimeException {
    private String errorMessage;
    private String errorCode;

    public GlobalCustomException() {
        super();
    }

    public GlobalCustomException(String message) {
        super(message);
    }

    public GlobalCustomException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;
    }

    public GlobalCustomException(GlobalErrorCode globalErrorCode) {
        super(globalErrorCode.getMessage());
        this.errorMessage = globalErrorCode.getMessage();
        this.errorCode = globalErrorCode.getCode();
    }
}
